Skip to content

Azure Static Webapp workflow testing - #71

Merged
susrisha merged 2 commits into
masterfrom
feature-deploy-workflow
Jul 1, 2026
Merged

Azure Static Webapp workflow testing#71
susrisha merged 2 commits into
masterfrom
feature-deploy-workflow

Conversation

@susrisha

@susrisha susrisha commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Github workflow for testing purpose
This pull request introduces a new GitHub Actions workflow for deploying the application to Azure Static Web Apps and adds a configuration file to support client-side routing. The main changes focus on automating the deployment process and ensuring proper routing behavior in the deployed app.

Deployment automation:

  • Added .github/workflows/deploy-to-azure.yml to automate deployments to Azure Static Web Apps, with support for multiple environments (production, staging, development, testing) and environment-specific configuration handling.

Routing configuration:

  • Added staticwebapp.config.json to enable navigation fallback, ensuring that client-side routing works correctly by rewriting all navigation requests to index.html.

Added a new GitHub Actions workflow to deploy the app to Azure Static Web Apps with manual environment selection for production, staging, development, and testing. The workflow prepares environment-specific config, builds the app, includes staticwebapp.config.json in the output, and deploys the generated static site with Azure’s deploy action.

Also added staticwebapp.config.json with a navigation fallback rule so unmatched routes rewrite to index.html, enabling client-side routing in the deployed app.

Github workflow for testing purpose
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@susrisha, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea7daeaf-0813-469f-b0f7-364a759c8025

📥 Commits

Reviewing files that changed from the base of the PR and between b072cc9 and c7ec82f.

📒 Files selected for processing (1)
  • .github/workflows/deploy-to-azure.yml
📝 Walkthrough

Walkthrough

This PR adds a GitHub Actions workflow for manually deploying to Azure Static Web Apps, including environment mapping, build steps, and deployment via the Azure static-web-apps-deploy action, plus a staticwebapp.config.json enabling SPA navigation fallback to index.html.

Changes

Azure Deployment Setup

Layer / File(s) Summary
Deployment workflow: environment mapping, build, and deploy
.github/workflows/deploy-to-azure.yml
Adds a manually-triggered workflow that maps a selected environment input to a deployment target label, checks out code, sets up Node 20, generates a .env file from `vars.ENV_CONFIG`, runs `npm run generate`, copies the static web app config, and deploys via `Azure/static-web-apps-deploy@v1`.
SPA navigation fallback config
staticwebapp.config.json
Adds a `navigationFallback` rule rewriting unmatched requests to `/index.html`.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SetEnvironmentJob
  participant BuildDeployJob
  participant AzureStaticWebApps

  User->>SetEnvironmentJob: workflow_dispatch (environment input)
  SetEnvironmentJob->>SetEnvironmentJob: map input to Testing/dev/stage/prod
  SetEnvironmentJob->>BuildDeployJob: pass target environment output
  BuildDeployJob->>BuildDeployJob: checkout, setup Node 20, install deps
  BuildDeployJob->>BuildDeployJob: build .env from vars.ENV_CONFIG, npm run generate
  BuildDeployJob->>AzureStaticWebApps: upload build output (skip_app_build: true)
Loading

Poem

A rabbit hops through YAML fields so bright,
Mapping envs from day into the night,
With jq and npm, the build takes flight,
To Azure's cloud, the app alights,
And /index.html catches every route just right! 🐇☁️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the new Azure Static Web Apps workflow, though it mentions testing instead of deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@susrisha
susrisha requested review from MashB and shweta2101 July 1, 2026 06:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
.github/workflows/deploy-to-azure.yml (3)

47-51: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Template expansion into shell (template-injection).

zizmor flags ${{ vars.ENV_CONFIG }} expanded directly into the run: script; if this value ever contains shell metacharacters it could break out of the quoting. Prefer passing it via env: and referencing the environment variable inside the script.

🛡️ Suggested fix
             - name: Ingest Environment Variables
+              env:
+                ENV_CONFIG: ${{ vars.ENV_CONFIG }}
               run: |
                 touch .env
-                echo '${{ vars.ENV_CONFIG }}' | jq -r 'to_entries | map("\(.key)=\(.value)") | .[]' > .env
+                echo "$ENV_CONFIG" | jq -r 'to_entries | map("\(.key)=\(.value)") | .[]' > .env
                 echo CI=false >> .env
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy-to-azure.yml around lines 47 - 51, The Ingest
Environment Variables step is expanding vars.ENV_CONFIG directly inside the run
script, which risks template-injection if the value contains shell
metacharacters. Update the workflow to pass ENV_CONFIG through env: on the step
and reference that variable inside the script instead of embedding ${{
vars.ENV_CONFIG }} in the shell command; keep the existing jq-based .env
generation logic in place.

Source: Linters/SAST tools


38-44: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Bump actions/checkout and actions/setup-node versions.

actionlint reports the runners for actions/checkout@v3 and actions/setup-node@v3 are too old for GitHub Actions. Per the retrieved learning, mutable tag usage itself isn't a concern in this repo, but this flags an actual deprecation, not a SHA-pinning preference.

♻️ Suggested fix
-              uses: actions/checkout@v3
+              uses: actions/checkout@v4
-              uses: actions/setup-node@v3
+              uses: actions/setup-node@v4
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy-to-azure.yml around lines 38 - 44, Bump the GitHub
Actions used in the deploy workflow: update the `actions/checkout` and
`actions/setup-node` steps in the workflow to newer supported major versions,
keeping the existing `ref` and `node-version` settings intact. Locate the
changes in the deploy workflow’s `checkout` and `Setup Node.js` steps and
replace the old action versions with current ones that satisfy actionlint’s
runner requirements.

Source: Linters/SAST tools


1-66: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add explicit least-privilege permissions: block.

zizmor flags excessive-permissions at the workflow and both job levels since no permissions: block is defined, defaulting to broad token scope. Given this workflow only checks out code and deploys, contents: read (plus nothing else needed by Azure/static-web-apps-deploy) should suffice.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy-to-azure.yml around lines 1 - 66, Add an explicit
least-privilege permissions block to the workflow and jobs because the default
GITHUB_TOKEN scope is too broad. Update the workflow definition in
deploy-to-azure.yml so the top-level and both jobs set only the minimal token
access needed, and ensure the checkout/deploy flow in set-github-environment and
build-and-deploy uses contents: read unless Azure/static-web-apps-deploy
requires any additional specific permission.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy-to-azure.yml:
- Around line 24-30: The environment mapping in the deploy workflow is reading
the wrong dispatch input, so `set-github-environment` never produces a target
value. Update the `case` in the workflow step to use the actual
`workflow_dispatch` input name (`inputs.environment`) instead of
`inputs.environment_input`, and keep the existing `target_env` mappings for
`testing`, `development`, `staging`, and `production` so the step outputs the
expected environment.

---

Nitpick comments:
In @.github/workflows/deploy-to-azure.yml:
- Around line 47-51: The Ingest Environment Variables step is expanding
vars.ENV_CONFIG directly inside the run script, which risks template-injection
if the value contains shell metacharacters. Update the workflow to pass
ENV_CONFIG through env: on the step and reference that variable inside the
script instead of embedding ${{ vars.ENV_CONFIG }} in the shell command; keep
the existing jq-based .env generation logic in place.
- Around line 38-44: Bump the GitHub Actions used in the deploy workflow: update
the `actions/checkout` and `actions/setup-node` steps in the workflow to newer
supported major versions, keeping the existing `ref` and `node-version` settings
intact. Locate the changes in the deploy workflow’s `checkout` and `Setup
Node.js` steps and replace the old action versions with current ones that
satisfy actionlint’s runner requirements.
- Around line 1-66: Add an explicit least-privilege permissions block to the
workflow and jobs because the default GITHUB_TOKEN scope is too broad. Update
the workflow definition in deploy-to-azure.yml so the top-level and both jobs
set only the minimal token access needed, and ensure the checkout/deploy flow in
set-github-environment and build-and-deploy uses contents: read unless
Azure/static-web-apps-deploy requires any additional specific permission.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a120528-16dd-4cbc-9f36-fd50ed65d0e5

📥 Commits

Reviewing files that changed from the base of the PR and between d7efd20 and b072cc9.

📒 Files selected for processing (2)
  • .github/workflows/deploy-to-azure.yml
  • staticwebapp.config.json

Comment thread .github/workflows/deploy-to-azure.yml
@susrisha
susrisha merged commit 388c807 into master Jul 1, 2026
1 of 2 checks passed
@susrisha
susrisha deleted the feature-deploy-workflow branch July 1, 2026 06:18
@coderabbitai coderabbitai Bot mentioned this pull request Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants